package com.payment.ktb.activity.main4;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.widget.TextView;

import com.payment.ktb.Fragment.BaseFragment;
import com.payment.ktb.Fragment.FragmentAgentManageAgentInfo;
import com.payment.ktb.Fragment.FragmentAgentManageMyInfo;
import com.payment.ktb.R;
import com.payment.ktb.activity.BaseActivity;
import com.payment.ktb.adapter.FragmentAdapterAgentManage;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by admin on 2017/12/4.
 */

public class AgentManageActivity extends BaseActivity {


    @BindView(R.id.vp_agentmanage)
    ViewPager vp_agentmanage;
    @BindView(R.id.tl_agentmanage)
    TabLayout tl_agentmanage;


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_agentmanage);
        ButterKnife.bind(this);
        initTitle("代理管理");
        initData();
        tl_agentmanage.setupWithViewPager(vp_agentmanage);
    }

    private void initData(){


        Fragment fragmentMyInfo = new FragmentAgentManageMyInfo();
        Fragment fragmentAgentInfo = new FragmentAgentManageAgentInfo();
        List<Fragment> fragments = new ArrayList<>();
        fragments.add(fragmentMyInfo);
        fragments.add(fragmentAgentInfo);

        String[] mTitle = new String[]{"我的信息", "代理信息"};

        FragmentAdapterAgentManage adapter = new FragmentAdapterAgentManage(getSupportFragmentManager(),fragments, Arrays.asList(mTitle));
        vp_agentmanage.setAdapter(adapter);
    }
}
